package com.athuiju.fenxiaoback.entity;


import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Good对象", description="商品表")
public class Goods {

    @Id
    private Long id; // spuId

    private String all; // 所有需要被搜索的信息，包含标题，分类，甚至品牌


    private Long brandId;// 品牌id
    private Long cid1;// 1级分类id
    private Long cid2;// 2级分类id
    private Long cid3;// 3级分类id

    private String spuImage;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date gmtCreate;// 创建时间

    private Set<Long> price;// 价格，对应到elasticsearch/json中是数组，一个spu有多个sku，就有多个价格

    private List<TbSku> skus;//sku集合

    private TbSpuDetail spuDetail;

    private String subTitle;// 商品卖点
    private String title;// 商品标题
    private Boolean saleable;//是否上架

    private Map<String, Object> specs;// 可搜索的规格参数，key是参数名，值是参数值



}
